'use strict';

/***
 * 基础配置文件，用于设置web存储，以及对应的字段
 */

export default class webStorage {

    constructor() {
    }

    static sessionGet(key) {
        // return sessionStorage.getItem(key);
        return localStorage.getItem(key);
    }

    static sessionSet(key, value) {
        // sessionStorage.setItem(key, value);
        localStorage.setItem(key, value);
    }

    static sessionDel(key) {
        sessionStorage.removeItem(key);
    }

    static localGet(key) {
        return localStorage.getItem(key);
    }

    static localSet(key, value) {
        localStorage.setItem(key, value);
    }

    static localDel(key) {
        localStorage.removeItem(key);
    }

    static sessionClear() {
        sessionStorage.clear();
    }

    static localClear() {
        localStorage.clear();
    }

    static clearAll() {
        sessionStorage.clear();
        localStorage.clear();
    }

    //存储在浏览器Session中用户名的key名字
    static GetSessionUserKeyName() {
        return "Name";
    }

    static GetSessionUserKeyNameID() {
        return "NameID";
    }

    //存储在浏览器Session中auth的key名字
    static GetSessionAuthKeyName() {
        return "NameAuth";
    }


    //存储在浏览器Session中登录状态的key名字
    static GetSessionAuthStateKeyName() {
        return "State";
    }

}
